#include <iostream>
#include "ThreadPool.h"
#include <unistd.h>

using std::cout;
using std::endl;

class SubTask : public Task
{
public:
    void run(void *args)
    {
        cout << "sleep start..." << endl;
        sleep(3);
        cout << "sleep end..." << endl;
    }
};

void test1()
{
    ThreadPool pool{10, 20};

    for (size_t idx{}; idx < 20; idx++)
    {
        pool.addTask(new SubTask());
    }
}

int main(int args, char *argv[])
{
    test1();

    return 0;
}